UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zK9AqB5FLEYox+FL4HEA3dA/itfM8MjVxxA/Ha46FX8='
WHERE
key_id = '1b26383f2931c314050a17c34de3aa0ca77a75eb739d3676ba48bf6974e08400'
AND (
token = 'zK9AqB5FLEYox+FL4HEA3dA/itfM8MjVxxA/Ha46FX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)