UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W307n/RUnL4eojy4udYVzEC+KnkPhdthKa3UVQOPZl4='
WHERE
key_id = 'dcbc6bbf99b55b176292c8ddc203001cc89800941ca7bca003f6020444d7eaf4'
AND (
token = 'W307n/RUnL4eojy4udYVzEC+KnkPhdthKa3UVQOPZl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)