UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gvEDDURWUUr1crQO2p1QLqt/QPrQ8+nIcNwUvmcUE/0='
WHERE
key_id = '9ac000e69663783d7e2546d1c5e49a99f6220d2610b35175075416ad9f56ca24'
AND (
token = 'gvEDDURWUUr1crQO2p1QLqt/QPrQ8+nIcNwUvmcUE/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)