UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HtDP8pU2Lrw/0Ux9GIeJBJ1SvKp7fPHJahxGksyEPpk='
WHERE
key_id = '1dfabb0747dcaf8a3cf9c7ff1e303c8a2bf8f57cd0bbbb8b7853d12e1ce98126'
AND (
token = 'HtDP8pU2Lrw/0Ux9GIeJBJ1SvKp7fPHJahxGksyEPpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)