UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3/vOIG28UbMVYy2DGirmocD+OfYiLRO5eIQbeE/pMkY='
WHERE
key_id = 'b105c411fa7ca1a6bbb611900936322cffe1f714d40994a44146abf1e27ce8a8'
AND (
token = '3/vOIG28UbMVYy2DGirmocD+OfYiLRO5eIQbeE/pMkY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)