UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vIr2y0Zp99GffuCF49BJzU1sz2nK0MnFOmGtmv11N8E='
WHERE
key_id = '8dc2d5e7e92408c4e6015dbb27a810a11d209334ed51c8caa2d3c70f1d581d96'
AND (
token = 'vIr2y0Zp99GffuCF49BJzU1sz2nK0MnFOmGtmv11N8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)