UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rPYbTWR14NxWaefaZ7/iTZAdQJwg3QYUldVG1oxiIJY='
WHERE
key_id = '1d4ee301054aac9bc635c46cc202a7516479b66c3eae71a7781043f4329a2143'
AND (
token = 'rPYbTWR14NxWaefaZ7/iTZAdQJwg3QYUldVG1oxiIJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)