UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GRoWYORLfC0iPTSO8HJFoOQ16oQ/kNZ9ukWBw+/xqRo=' 
WHERE 
  key_id = '3bc8842445f0d05eee21d2618ecd6ebc997a53ce8b932566bdfefd75e73fb76b' 
  AND (
    token = 'GRoWYORLfC0iPTSO8HJFoOQ16oQ/kNZ9ukWBw+/xqRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038