UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LaO+guRHO4aikd4mdby1EFyzFyf4CZ3B8N6z/WS8HDg=' 
WHERE 
  key_id = '258edc3b520e8089f1deaec240178dc37fb5498a9658691552dabc227b87fa90' 
  AND (
    token = 'LaO+guRHO4aikd4mdby1EFyzFyf4CZ3B8N6z/WS8HDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027