UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S/9I6gsQxfxY5tjl3uCsn3xWZ4vjhHmEhWkzR7i0BIg='
WHERE
key_id = '5e05a9e8d736c8373d526a81c4614e2f950e03b71eb6c5e69f235ebe98452c68'
AND (
token = 'S/9I6gsQxfxY5tjl3uCsn3xWZ4vjhHmEhWkzR7i0BIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)