UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LVXqTiLpK6Y3dBP16Io/55YU+Tz7E6CCdtlyyozI9Ow='
WHERE
key_id = '21489ba022b86c7910f50bf711a881741227c16f843412daee206317a53fc610'
AND (
token = 'LVXqTiLpK6Y3dBP16Io/55YU+Tz7E6CCdtlyyozI9Ow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)