UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BRIdxuZNcBwkRHoF/mt3dxtI2i5aVlZbrACYzeFyuFw='
WHERE
key_id = '5ed20f0f06396f96ec806fcd34e3bb87db392b31fd3556d600d6ee47805cad31'
AND (
token = 'BRIdxuZNcBwkRHoF/mt3dxtI2i5aVlZbrACYzeFyuFw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)