UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4HAoxrwpz+3dQBZdpVI231Cx1u/PRNxYeHC0HTre1QI=' 
WHERE 
  key_id = 'e02a6ef8db27c3fd0a9bc295dd46813d853edf9f65db709cda4a4bc3592c0ed1' 
  AND (
    token = '4HAoxrwpz+3dQBZdpVI231Cx1u/PRNxYeHC0HTre1QI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023