UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7DdnV3WhNwD9pzq7Si83RK3Xu/p/gkar3hL4NsO5DL4='
WHERE
key_id = '659c30d294ff207c8d2e6a8bbf0c053ed73ea768db190138c578a1c1a61192d3'
AND (
token = '7DdnV3WhNwD9pzq7Si83RK3Xu/p/gkar3hL4NsO5DL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)