UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DN2pHebs4OOuw2Dvt+DJeZxbOHH1TEFq8vKn1pz6C4c=' 
WHERE 
  key_id = '73018bdb76cd57f986049a4bd0acec8c3383bc5e28ae05864e99c97e35e1f76a' 
  AND (
    token = 'DN2pHebs4OOuw2Dvt+DJeZxbOHH1TEFq8vKn1pz6C4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020