UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iqB/g/YKgkfZrh+p568/P0M0j67VEOgSLy//Ic2MQXw='
WHERE
key_id = '2da61f6d4421122570b326ebfd9698cec8726c97450b6f899cfc98df1a1a2e07'
AND (
token = 'iqB/g/YKgkfZrh+p568/P0M0j67VEOgSLy//Ic2MQXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)