UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z5jaxvXAtmL4DckriT4m5QV8guasflBDD7m/1bWnDgw='
WHERE
key_id = '7757c050327825064ec5163e6427000feabe65dd6a6d13bf94c8e25a7ecf572e'
AND (
token = 'z5jaxvXAtmL4DckriT4m5QV8guasflBDD7m/1bWnDgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)