UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C0sMTQ0KvEwHQu4lLz3LqoLhvSgdAofl3NCvhGcTwzE='
WHERE
key_id = '398489b49d5512271fe9931b86e641d995fc7c3a6c27b01d644d0e1e9b02e665'
AND (
token = 'C0sMTQ0KvEwHQu4lLz3LqoLhvSgdAofl3NCvhGcTwzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)