UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VgtQX8NMYFZCXWcbxjqLoqTErWlcTlh7Yb0OglZV6yU=' 
WHERE 
  key_id = 'e5447171b4abdb520b7e46bb8783067722072c63a12b2b18b42255b35e9539d2' 
  AND (
    token = 'VgtQX8NMYFZCXWcbxjqLoqTErWlcTlh7Yb0OglZV6yU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026