UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/+4Rf9KUaq+k9zVVTHbyPewLpWGuDA4m7jFUwnpdmuQ=' 
WHERE 
  key_id = 'e048114d2eacec226923bcc01a8adde8d6b98132697f9873155b45fec9873d99' 
  AND (
    token = '/+4Rf9KUaq+k9zVVTHbyPewLpWGuDA4m7jFUwnpdmuQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028