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

Query time 0.00033