UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YuPDFiW7lZoCCnx5JzeYaygCKcb+R/nyZWkKN6uUheo='
WHERE
key_id = '46402e04d4e43e0c1c0f5d20c40ed17f3d27ed56c16b5df5d2a72400d9cfc551'
AND (
token = 'YuPDFiW7lZoCCnx5JzeYaygCKcb+R/nyZWkKN6uUheo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)