UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4CXmySXhwXEV9V1h8zxgHxfQPWD3sbiOaseV583sJ7M=' 
WHERE 
  key_id = '3a29e353db797c64f79391722b5a61ef8756739f1fcfb2a58069d5f7d5f292e7' 
  AND (
    token = '4CXmySXhwXEV9V1h8zxgHxfQPWD3sbiOaseV583sJ7M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029