UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZCH6oB1HXM9tOesbRV6DUKd1IAJW6073TEjy4N0IDHM='
WHERE
key_id = '36a8e013558f6db0999bb9644d635b2104427d204f19209b34ed8430635d7011'
AND (
token = 'ZCH6oB1HXM9tOesbRV6DUKd1IAJW6073TEjy4N0IDHM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)