UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jwiAUlZrMfJ/cA0Mn/d9yNP1OnWRXg+Ki/FOkQWz09o=' 
WHERE 
  key_id = '0d734c46ab631e4f2f8fa8e5ec69258727084829b653e56bb741ba2aa9723008' 
  AND (
    token = 'jwiAUlZrMfJ/cA0Mn/d9yNP1OnWRXg+Ki/FOkQWz09o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024