UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O/O26GsABtZ0y6LoZS3dHmFko1QuA5B1R7U2Daue9Es=' 
WHERE 
  key_id = '2d10ab819df941c60b1beec64bed6665f5ed0dd75b0d30823988bb45f206f481' 
  AND (
    token = 'O/O26GsABtZ0y6LoZS3dHmFko1QuA5B1R7U2Daue9Es=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032