UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mDT7+EOutZ6D8fTX7Lue06pmGchaoIKTvA0jlyteypU='
WHERE
key_id = '428d04fd745f14377d0ff4aac2de0792311172ac712ef1db8d6bed5e490c83ff'
AND (
token = 'mDT7+EOutZ6D8fTX7Lue06pmGchaoIKTvA0jlyteypU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)