UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hZ1qfnm9MhhlI+T+K8B4WXIuWPMYrXlYLATRP/eyhw='
WHERE
key_id = 'bd6a82a7c58bf7f71f742ca0136e3a25139c1cb795f19009d35ae97b9d2387df'
AND (
token = '3hZ1qfnm9MhhlI+T+K8B4WXIuWPMYrXlYLATRP/eyhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)