UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MMZrpKX4E9RJLHGTZLmFtzhP9dNGqMNcwBtIDt6YUQI=' 
WHERE 
  key_id = 'ad78c41a003a5c710fbfe3da1065c696fe95582f1a2c5bae413350819000e6ad' 
  AND (
    token = 'MMZrpKX4E9RJLHGTZLmFtzhP9dNGqMNcwBtIDt6YUQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029