UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mDk2iC2XYePW/8jEKMGHbd7IIT1D96X8a0vBiHME0/0='
WHERE
key_id = '18a97669719f92b708a0e13de58a77c989ea0310f9987e65644b0c46a44875d8'
AND (
token = 'mDk2iC2XYePW/8jEKMGHbd7IIT1D96X8a0vBiHME0/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)