UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/oxO2JibN329JaI/GJMW6mjq54+PGaW5jOxvRa2rWvA='
WHERE
key_id = 'e5e58730ccc5512406f771b685d87aa92ca6f9ca3d68990e5f116b7e91ae8625'
AND (
token = '/oxO2JibN329JaI/GJMW6mjq54+PGaW5jOxvRa2rWvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)