UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0sDNh1AKIYBt5iWinn/BfrfNhfYd8UjNKWgJJWm0EVM=' 
WHERE 
  key_id = '0d328d3908d69ff501d936f5980adbfd14e24dcedf090cd706b1c6711d4225cd' 
  AND (
    token = '0sDNh1AKIYBt5iWinn/BfrfNhfYd8UjNKWgJJWm0EVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024