UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oMoPHZWTEFXd2Q1QAk2SOkuWUPC1NF+udp9o8zrNSDo=' 
WHERE 
  key_id = '00b65a08f104c0a41a132409139250c3432514229d866f25479b77a5f06daa57' 
  AND (
    token = 'oMoPHZWTEFXd2Q1QAk2SOkuWUPC1NF+udp9o8zrNSDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019