UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wZ4v+HhNvEstcWR4kUUcc7RmQjWN+nLol7MMXhJZkzk='
WHERE
key_id = '1cf3554d9f5e6020f14e8c8e90f6d4cb3158f1543b2fe2f71224363f25c67729'
AND (
token = 'wZ4v+HhNvEstcWR4kUUcc7RmQjWN+nLol7MMXhJZkzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)