UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AoHWnCkVpOshKhmol+J4biqo6kaBHgKjWdHVSblynv0='
WHERE
key_id = '27508f6480bdb039f7e88b2190c97dc4a46be7fe2d1cfeccdd16e7b196c6f9a3'
AND (
token = 'AoHWnCkVpOshKhmol+J4biqo6kaBHgKjWdHVSblynv0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)