UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/LTzvW9j+nyrKAh7xmdsWAD21MsZqGXMCx36PNBVpUU=' 
WHERE 
  key_id = '712ec082acd264a7eb52eb083e8cbde63a2153f159fe865c7f5fcb9398fe5e26' 
  AND (
    token = '/LTzvW9j+nyrKAh7xmdsWAD21MsZqGXMCx36PNBVpUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040