UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2P9ZUwPmr3zJIpVW/7aGUaYpuUflTAEBdh9Yg/ijs3A='
WHERE
key_id = '925d3b76997e50f485262ea4ba9e6da9e9a33fafb94d7a8cb59fa8b63c9909be'
AND (
token = '2P9ZUwPmr3zJIpVW/7aGUaYpuUflTAEBdh9Yg/ijs3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)