UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'djsz6vMB35Av/I9Gi2+dzfouaCav/B5T4BNMFtbLJj4=' 
WHERE 
  key_id = '5e5c76ec98fc18087668038d2ed38ccf8a9f60c72d87a9f1c8e6894a5b71e565' 
  AND (
    token = 'djsz6vMB35Av/I9Gi2+dzfouaCav/B5T4BNMFtbLJj4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038