UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j31tkok4UXyZfrAYrOvgN45LB2QQZLsa9o38nyxumJE='
WHERE
key_id = '5e48bad1017bd06c92460410edbdf2650a1e2407ad0a89c2a2e7dac2d5aa59c5'
AND (
token = 'j31tkok4UXyZfrAYrOvgN45LB2QQZLsa9o38nyxumJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)