UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7WGMXEicCxXZAlWtIw4I/lzQFed9GutuygHYnONMRVs='
WHERE
key_id = '5b55ddbb77e7dbf43fa06ebe9862cccdf987cbdc51aa2c32c5c6ef079c91c3c1'
AND (
token = '7WGMXEicCxXZAlWtIw4I/lzQFed9GutuygHYnONMRVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)