UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aLNOU3Ecu2pm4EC3Arb96Wy7wHCoWv8yai0EQqQ8b/g='
WHERE
key_id = '4e97b063a1db3dbd3781d316c4e0bf74661da1f90ac3d6757151ee95978c3607'
AND (
token = 'aLNOU3Ecu2pm4EC3Arb96Wy7wHCoWv8yai0EQqQ8b/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)