UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GyG4fe9PQ9e5yu9Ufnl5/+FONILQWzNqYa4jLzPo+8E=' 
WHERE 
  key_id = 'b557580e231b330ea0493b3feaeef79d63ad1cf300875b88364148dc63512b8d' 
  AND (
    token = 'GyG4fe9PQ9e5yu9Ufnl5/+FONILQWzNqYa4jLzPo+8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020