UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0wOjAGgBXzdnSAkkjkOGPNDTcDOChsB/lPXyr4awsR4=' 
WHERE 
  key_id = 'ce781a8e9bdbd48d02a313f2aff6f650973abaaed138a41c7f33021478824948' 
  AND (
    token = '0wOjAGgBXzdnSAkkjkOGPNDTcDOChsB/lPXyr4awsR4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027