UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MnqJw1qPWLNxQSrWUkzH0EvZR6NOFHgV9isrCFdmZ9I=' 
WHERE 
  key_id = '5e84a6224b64296b7c35f34b5672048094dfd2a3c185eda815d07ed389ba0207' 
  AND (
    token = 'MnqJw1qPWLNxQSrWUkzH0EvZR6NOFHgV9isrCFdmZ9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043