UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VYHv0ZsMpfUF6bjU3dUPmF4eFLJkHWIvmmHwIYOY4os='
WHERE
key_id = '259a3ee5793f3d2415197f21cf67f173870c2018636a4b1a0cb8a67ba58f8f26'
AND (
token = 'VYHv0ZsMpfUF6bjU3dUPmF4eFLJkHWIvmmHwIYOY4os='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)