UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PcfqoCXUc5yGR5on/2Ij61SArCw4U3Kjro1Y5HwBZms='
WHERE
key_id = '41bcc3d012951c005f0b3fb9eb48b8202c46c7c043f349d3750e301a754662ce'
AND (
token = 'PcfqoCXUc5yGR5on/2Ij61SArCw4U3Kjro1Y5HwBZms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)