UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/xm+w9tOFhIBXwNlpWCd389nR77+0QuE2dRd9Ehqcek=' 
WHERE 
  key_id = 'ef2684fbb4d1c57afb379d19f00033a0f4235fe20100f7b86d7393e3acd6225e' 
  AND (
    token = '/xm+w9tOFhIBXwNlpWCd389nR77+0QuE2dRd9Ehqcek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052