UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SGZxx81BH6qp0UIu6kv6C6AZ2Dv+GB5zG2P3ngynFNY=' 
WHERE 
  key_id = 'cdfcf732bb777732910aa0bf6cef57e9d03cd8a8939e1d6b498471290ac34b04' 
  AND (
    token = 'SGZxx81BH6qp0UIu6kv6C6AZ2Dv+GB5zG2P3ngynFNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048